import request from '../../utils/Request'

export const userLogin = data => {
  return request({
    method: 'post',
    url: '/api/manage/login',
    data: data
  })
}

export const userLogout = () => {
  return request({
    method: 'get',
    url: '/api/manage/logout',
    params: {}
  })
}

export const getLoginUser = () => {
  return request({
    method: 'get',
    url: '/api/manage/login/user',
    params: {}
  })
}

export const getKaptcha = bId => {
  return request({
    method: 'get',
    responseType: 'blob',
    url: '/api/manage/kaptcha/create/' + bId,
    params: {}
  })
}

export const updatePassword = data => {
  return request({
    method: "post",
    url: '/api/manage/updatePassword',
    data: data
  })
}

export const getPublicKey = account => {
  return request({
    method: "get",
    url: '/api/manage/rsa/encrypt/'+account,
  })
}

export const enPassword = data=> {
  return request({
    method: "get",
    url: '/api/manage/rsa/password',
    params: data,
  })
}

